home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / wave.exe / WAVES2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-07-18  |  6.8 KB  |  227 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Wave VBX Loop Sample"
  6.    ClientHeight    =   2985
  7.    ClientLeft      =   1650
  8.    ClientTop       =   1920
  9.    ClientWidth     =   4095
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   1
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   3390
  21.    Left            =   1590
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   2985
  24.    ScaleWidth      =   4095
  25.    Top             =   1575
  26.    Width           =   4215
  27.    Begin VB.CheckBox chkLoop 
  28.       Caption         =   "Continuous Playing (Loop)"
  29.       BeginProperty Font 
  30.          name            =   "MS Sans Serif"
  31.          charset         =   0
  32.          weight          =   400
  33.          size            =   8.25
  34.          underline       =   0   'False
  35.          italic          =   0   'False
  36.          strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   255
  39.       Left            =   240
  40.       TabIndex        =   6
  41.       Top             =   1200
  42.       Width           =   3615
  43.    End
  44.    Begin VB.CheckBox chkExclusive 
  45.       Caption         =   "Exclusive Playing"
  46.       BeginProperty Font 
  47.          name            =   "MS Sans Serif"
  48.          charset         =   0
  49.          weight          =   400
  50.          size            =   8.25
  51.          underline       =   0   'False
  52.          italic          =   0   'False
  53.          strikethrough   =   0   'False
  54.       EndProperty
  55.       Height          =   255
  56.       Left            =   240
  57.       TabIndex        =   5
  58.       Top             =   840
  59.       Width           =   3615
  60.    End
  61.    Begin VB.TextBox txtFilename 
  62.       Appearance      =   0  'Flat
  63.       BeginProperty Font 
  64.          name            =   "MS Sans Serif"
  65.          charset         =   0
  66.          weight          =   400
  67.          size            =   8.25
  68.          underline       =   0   'False
  69.          italic          =   0   'False
  70.          strikethrough   =   0   'False
  71.       EndProperty
  72.       Height          =   285
  73.       Left            =   240
  74.       TabIndex        =   2
  75.       Text            =   "C:\WINDOWS\RINGIN.WAV"
  76.       Top             =   480
  77.       Width           =   3615
  78.    End
  79.    Begin VB.CommandButton btnStop 
  80.       Appearance      =   0  'Flat
  81.       BackColor       =   &H80000005&
  82.       Caption         =   "Stop"
  83.       BeginProperty Font 
  84.          name            =   "MS Sans Serif"
  85.          charset         =   0
  86.          weight          =   400
  87.          size            =   8.25
  88.          underline       =   0   'False
  89.          italic          =   0   'False
  90.          strikethrough   =   0   'False
  91.       EndProperty
  92.       Height          =   375
  93.       Left            =   2160
  94.       TabIndex        =   1
  95.       Top             =   2400
  96.       Width           =   1575
  97.    End
  98.    Begin VB.CommandButton btnPlay 
  99.       Appearance      =   0  'Flat
  100.       BackColor       =   &H80000005&
  101.       Caption         =   "Play"
  102.       BeginProperty Font 
  103.          name            =   "MS Sans Serif"
  104.          charset         =   0
  105.          weight          =   400
  106.          size            =   8.25
  107.          underline       =   0   'False
  108.          italic          =   0   'False
  109.          strikethrough   =   0   'False
  110.       EndProperty
  111.       Height          =   375
  112.       Left            =   360
  113.       TabIndex        =   0
  114.       Top             =   2400
  115.       Width           =   1575
  116.    End
  117.    Begin WaveLib.Wave Wave1 
  118.       Left            =   3360
  119.       Top             =   0
  120.       _version        =   65537
  121.       _extentx        =   847
  122.       _extenty        =   847
  123.       _stockprops     =   64
  124.       exclusive       =   0   'False
  125.       filename        =   ""
  126.       filelength      =   0
  127.       loop            =   0   'False
  128.       playend         =   -1
  129.       playstart       =   -1
  130.    End
  131.    Begin VB.Label Label2 
  132.       Alignment       =   2  'Center
  133.       Appearance      =   0  'Flat
  134.       BackColor       =   &H00C0C0C0&
  135.       BackStyle       =   0  'Transparent
  136.       BeginProperty Font 
  137.          name            =   "MS Sans Serif"
  138.          charset         =   0
  139.          weight          =   400
  140.          size            =   8.25
  141.          underline       =   0   'False
  142.          italic          =   0   'False
  143.          strikethrough   =   0   'False
  144.       EndProperty
  145.       ForeColor       =   &H80000008&
  146.       Height          =   255
  147.       Left            =   240
  148.       TabIndex        =   4
  149.       Top             =   1680
  150.       Width           =   3615
  151.    End
  152.    Begin VB.Label Label1 
  153.       Appearance      =   0  'Flat
  154.       Caption         =   "Filename:"
  155.       BeginProperty Font 
  156.          name            =   "MS Sans Serif"
  157.          charset         =   0
  158.          weight          =   400
  159.          size            =   8.25
  160.          underline       =   0   'False
  161.          italic          =   0   'False
  162.          strikethrough   =   0   'False
  163.       EndProperty
  164.       ForeColor       =   &H80000008&
  165.       Height          =   255
  166.       Left            =   240
  167.       TabIndex        =   3
  168.       Top             =   240
  169.       Width           =   1935
  170.    End
  171. Attribute VB_Name = "Form1"
  172. Attribute VB_Creatable = False
  173. Attribute VB_Exposed = False
  174. Option Explicit
  175. Dim fChanged As Integer ' flag: has filename changed?
  176. Private Sub btnPlay_Click()
  177.     ' make sure the filename is up to date
  178.     SetFilename
  179.     ' play the file
  180.     Wave1.Action = 1
  181.     EnableButtons
  182.     Label2 = "Playing"
  183. End Sub
  184. Private Sub btnStop_Click()
  185.     ' stop playing
  186.     Wave1.Action = 4
  187.     ' update buttons
  188.     EnableButtons
  189. End Sub
  190. Private Sub chkExclusive_Click()
  191.     Wave1.Exclusive = (chkExclusive.Value <> 0)
  192. End Sub
  193. Private Sub chkLoop_Click()
  194.     Wave1.Loop = (chkLoop.Value <> 0)
  195. End Sub
  196. Private Sub EnableButtons()
  197.     ' set button status
  198.     Select Case Wave1.Status
  199.         Case 1: ' playing
  200.             btnStop.Enabled = True
  201.         Case 4: ' stopped
  202.             btnStop.Enabled = False
  203.     End Select
  204. End Sub
  205. Private Sub Form_Load()
  206.     fChanged = True
  207.     EnableButtons
  208. End Sub
  209. Private Sub SetFilename()
  210.     ' if the filename has changed, tell Wave VBX
  211.     If fChanged Then
  212.         ' changed no more
  213.         fChanged = False
  214.         Wave1.filename = txtFilename
  215.     End If
  216. End Sub
  217. Private Sub txtFilename_Change()
  218.     fChanged = True
  219. End Sub
  220. Private Sub Wave1_PlayDone()
  221.     EnableButtons
  222.     Label2 = "Stopped"
  223. End Sub
  224. Private Sub Wave1_PlayLoop(LoopCount As Integer)
  225.     Label2 = "Playing (" & LoopCount & " times)"
  226. End Sub
  227.